<?php
include '../c/config.php';
$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqli->error);}
$query=$mysqli->query("SELECT * FROM `ti`  ");
$i=1;

$xuanze=array();
while ($list=$query->fetch_array()) {
    $xuanze[$i]=trim($list['dan']);
 
$i++;
}

$getData=array(
   'xz' => $xuanze
);


var_dump($getData);
file_put_contents('xiaoxues.txt', json_encode($getData));

$mysqli->close();
 